package com.siwei.mes.config;

import com.siwei.mes.entity.system.CompanyConfig;
import com.siwei.mes.service.system.CompanyConfigService;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * @Description: 企业配置信息
 * @Version: 1.0
 * @author: yangke
 * @date: 2024/11/21 21:01
 */
@Component
public class CompanyConfigInterceptor {
    @Resource
    private CompanyConfigService companyConfigService;

    private static CompanyConfigService serial;

    /**
     * 初始化
     */
    @PostConstruct
    public void init() {
        serial = companyConfigService;
    }

    /**
     * 生成编号保存到数据库
     *
     * @param id
     * @return
     */
    public static CompanyConfig getCompanyConfig(int id) {
        return serial.loadById((long) id);
    }

}
